package com.sbj.dto.res;

import cn.zhxu.bs.bean.DbField;
import cn.zhxu.bs.bean.SearchBean;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.sbj.dto.jackson.CustomDecimalSerialize;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @author summer
 * @version 1.0
 * @date 2024/9/12 16:33
 */
@Data
@SearchBean(tables = " order_goods o left join goods g    ON o.goods_id=g.id  left join  quality  q ON q.id=g.quality_id",autoMapTo = "o")
public class OrderGoodsRes implements Serializable {

    @DbField("o.goods_id")
    private Integer goodsId;

    @DbField("o.goods_num")
    private Integer goodsNum;

    @DbField("o.goods_price")
    @JsonSerialize(using = CustomDecimalSerialize.class)
    private BigDecimal goodsPrice;

    @DbField("g.image")
    private String image;

    @DbField("q.name")
    private String qualityName;

    @DbField("g.name")
    private String name;

    @DbField("o.order_id")
    private Integer orderId;
}
